import time
a=[]
def buben(f):
    for i in f:
        a.append(int(i))
    st=time.time()
    for x in range(len(a)-2):
        for y in range(x+1,len(a)-1):
            if a[y]>a[y+1]:
                a[y],a[y+1]=a[y+1],a[y]
    tfin=time.time()
    t=(tfin-st)*1000
    return t
f1=open('m1_sorted.txt')
f2=open('m2_reverse.txt')
f3=open('m3_shuffle.txt')
print('m1_sorted.txt', int(buben(f1)), 'milliseconds')
print('m2_reverse.txt', int(buben(f2)), 'milliseconds')
print('m3_shuffle.txt', int(buben(f3)), 'milliseconds')
